package com.lovely602.ai.ollama.controller;


import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *  本地大模型管理器
 *
 * @author lizhixing
 */
@RestController
public class OllamaController {


    @Autowired
    private OllamaChatModel ollamaChatModel;

    @GetMapping(value = "/ollama/chat")
    public String chat(@RequestParam(value = "msg") String msg) {
        return ollamaChatModel.call(msg);
    }

}
